package com.mybatistest.mapper;

import com.mybatistest.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("SELECT * from dept")
    List<Dept> list();

    @Delete("DELETE from dept where id=#{id}")
    void deleteById(Integer id);

    @Insert("INSERT INTO dept(name,createTime,updateTime) VALUES(#{name},#{createTime},#{updateTime})")
    void save(Dept dept);
}
